import NotFound from '@/NotFound.vue';
import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router';

const routes: Array<RouteRecordRaw> = [
  { path: '/', redirect: '/home' },
  { path: '/home', component: () => import('@/views/home/index.vue') },
  {
    path: '/home',
    children: [
      { path: 'game', component: () => import('@/views/home/game.vue') },
      { path: 'movie', component: () => import('@/views/home/movie.vue') },
      { path: 'teleplay', component: () => import('@/views/home/teleplay.vue') },
    ],
  },

  { path: '/404', component: NotFound },
  { path: '/:catchAll(.*)', redirect: '/404' },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
